{include file="Public:header" /}
{include file="Public:nav" /}		

		<div class="page page-current" id="order">
			<div class="bar bar-nav">
				<h1 class="title">订单列表</h1>
				<i class="icon icon-left" onclick="window.history.go(-1);"></i>
			</div>
			
			<div class="content">
			<div class="buttons-tab fixed-tab" data-offset="34" style="margin-top:10px;">
				<a class="tab-link button active" href="#order_1">全部</a>
				<a class="tab-link button" href="#order_2">待付款</a>
				<a class="tab-link button" href="#order_3">待参与</a>
				<a class="tab-link button" href="#order_4">已完成</a>
				<a class="tab-link button" href="#order_5">已取消</a>
			</div>
			<div class="tabs">
				<div class="tab active" id="order_1">
				{if condition="$all_show"}<div style="text-align:center;"><a style="font-size:12px;border-bottom:1px solid #ddd;line-height:20px;display:inline-block;margin-bottom: 10px;">我有{$all_count}个订单</a></div>{/if}
				<div id="all_activity">
				  {foreach name="all" item="all" key="k"}
					 <div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> {$all['sponsor']}</span>
					  <a>
					  	 {if condition="$all['order_status'] eq 1"}待付款
					  	 {elseif condition="$all['order_status'] eq 2"/}待参与
					  	 {elseif condition="$all['order_status'] eq 3"/}已完成
					  	 {/if}
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="{:U('orderDetail',array('order_id'=>$all['id']))}">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="{$all['activity_img']}" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title">{$all['activity_name']}</div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$all['area']}&nbsp;&nbsp;&nbsp;{$all['signup_number']}人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$all['start_time']|date="Y-m-d",###} 至 {$all['end_time']|date="Y-m-d",###}</p>
					          </div>
					        </li>
					      </ul>
					    </div>
					   </a> 
					  </div>
					  <div class="card-footer"><span>￥<font>{$all['amount']}</font></span>
					  <span>
					  {if condition="$all['order_status'] eq 1"} 
					  <form action="{:U('Wxpay/js_api_call')}" method="post" style="display: inline-block;">
					  	<input type="hidden" name="order_sn" value="{$all['order_sn']}" />	
					  	<button type="submit"  style="display: inline-block;" class="button button-fill" >去付款</button>
					  </form>
					  <a style="display: inline-block;" href="{:U('cancelOrder',array('order_id'=>$all['id']))}" class="button button-fill" >取消订单</a>
					  {elseif condition="$all['order_status'] eq 2" /}
					  <a style="display: inline-block;" href="{:U('electronics',array('order_id'=>$all['id']))}" class="button button-fill" >查看电子票</a>
					  {elseif condition="$all['order_status'] eq 3" /}
					  <a style="display: inline-block;" href="{:U('Users/orderDetail',array('order_id'=>$all['id']))}" class="button button-fill">已完成</a>
					  {elseif condition="$all['order_status'] eq 4" /}
					  <a style="display: inline-block;" href="{:U('Users/orderDetail',array('order_id'=>$all['id']))}" class="button button-fill">已取消</a>
					  {/if}
					  </span>
					  </div>
					</div>
					{/foreach}
				</div>
					{if condition="$all_show"}
					<div class="infinite-scroll-preloader" id="all_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_submit();" class="all_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					{else/}
					<p id="load_more"> 暂无数据！</p>
					{/if}
				</div>
			
			 		
		
			
			<div class="tab" id="order_2">
			<div id="stay_activity">
					{foreach name="stay" item="stay" key="k"}
					  <div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> {$stay['sponsor']}</span>
					  <a>
					  	 待付款
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="{:U('orderDetail',array('order_id'=>$stay['id']))}">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="{$stay['activity_img']}" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title">{$stay['activity_name']}</div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$stay['area']}&nbsp;&nbsp;&nbsp;{$stay['signup_number']}人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$stay['start_time']|date="Y-m-d",###} 至 {$stay['end_time']|date="Y-m-d",###}</p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font>{$stay['amount']}</font></span>
					  <span>
					  <form action="{:U('Wxpay/js_api_call')}" method="post" style="display: inline-block;">
					  	<input type="hidden" name="order_sn" value="{$stay['order_sn']}" />	
					  	<button type="submit"  style="display: inline-block;" class="button button-fill" >去付款</button>
					  </form>
					  <a style="display: inline-block;" href="{:U('cancelOrder',array('order_id'=>$stay['id']))}" class="button button-fill" >取消订单</a>
					  </span>
					  </div>
					</div>
					{/foreach}
			 </div>
			 		{if condition="$stay_show"}
					<div class="infinite-scroll-preloader" id="stay_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_stay_submit();" class="stay_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					{else/}
					<p id="load_more"> 暂无数据！</p>
					{/if}
			</div>
					
			
			
			
			<div class="tab" id="order_3">
				<div id="not_activity">
					{foreach name="stay_participate" item="stay_participate" key="k"}
					<div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> {$stay_participate['sponsor']}</span>
					  <a>
					  	 待参与
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="{:U('orderDetail',array('order_id'=>$stay_participate['id']))}">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="{$stay_participate['activity_img']}" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title">{$stay_participate['activity_name']}</div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$stay_participate['area']}&nbsp;&nbsp;&nbsp;{$stay_participate['signup_number']}人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$stay_participate['start_time']|date="Y-m-d",###} 至 {$stay_participate['end_time']|date="Y-m-d",###}</p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font>{$stay_participate['amount']}</font></span>
					  <span>
					  <a href="{:U('electronics',array('order_id'=>$stay_participate['id']))}" style="display: inline-block;" class="button button-fill" >查看电子票</a>
					  </span>
					  </div>
					</div>
					{/foreach}
			 </div>
			 		{if condition="$stay_participate_show"}
					<div class="infinite-scroll-preloader" id="not_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_not_submit();" class="not_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					{else/}
					<p id="load_more"> 暂无数据！</p>
					{/if}
			</div>
			
			
			<div class="tab" id="order_4">
				<div id="complete_activity">
					{foreach name="complete" item="complete" key="k"}
					<div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> {$complete['sponsor']}</span>
					  <a>
					  	 已完成
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="{:U('orderDetail',array('order_id'=>$complete['id']))}">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="{$complete['activity_img']}" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title">{$complete['activity_name']}</div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$complete['area']}&nbsp;&nbsp;&nbsp;{$complete['signup_number']}人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$complete['start_time']|date="Y-m-d",###} 至 {$complete['end_time']|date="Y-m-d",###}</p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font>{$complete['amount']}</font></span>
					  <span>
					  <a href="{:U('Users/orderDetail',array('order_id'=>$complete['id']))}" style="display: inline-block;" class="button button-fill" >查看</a>
					  </span>
					  </div>
					</div>
					{/foreach}
			 </div>
			 		{if condition="$complete_show"}
					<div class="infinite-scroll-preloader" id="complete_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_complete_submit();" class="complete_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					{else/}
					<p id="load_more"> 暂无数据！</p>
					{/if}
			</div>
			
			
			<div class="tab" id="order_5">
				<div id="cancel_activity">
					{foreach name="cancel" item="cancel" key="k"}
					<div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> {$cancel['sponsor']}</span>
					  <a>
					  	 已取消
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="{:U('orderDetail',array('order_id'=>$cancel['id']))}">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="{$cancel['activity_img']}" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title">{$cancel['activity_name']}</div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$cancel['area']}&nbsp;&nbsp;&nbsp;{$cancel['signup_number']}人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray">{$cancel['start_time']|date="Y-m-d",###} 至 {$cancel['end_time']|date="Y-m-d",###}</p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font>{$cancel['amount']}</font></span>
					  <span>
					  <a href="{:U('Users/orderDetail',array('order_id'=>$cancel['id']))}" style="display: inline-block;" class="button button-fill" >查看</a>
					  </span>
					  </div>
					</div>
					{/foreach}
			 </div>
			 		{if condition="$cancel_show"}
					<div class="infinite-scroll-preloader" id="complete_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_cancel_submit();" class="cancel_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					{else/}
					<p id="load_more"> 暂无数据！</p>
					{/if}
			</div>
			
			
			
			</div>
		</div>
		</div>
		<div class="page" id="order_page">
			<div class="bar bar-nav">
				<h1 class="title">订单详情</h1>
				<i class="icon icon-left" onclick="window.history.go(-1);"></i>
			</div>
			<nav class="bar bar-tab ticket-tab">
				<a class="tab-item" href="publish_1.html">
					<span class="icon iconfont icon-add"></span>
					<span class="tab-label">我要发布活动</span>
				</a>
				<a class="tab-item open-3-modal">
					<span class="icon icon-check"></span>
					<span class="tab-label">完成活动</span>
				</a>
			</nav>
			<div class="content">
				<div class="list-block ticket">
				    <ul>
				    	<li class="item-content">
					        <div class="item-inner">
					          <p class="item-title">免费票<span>￥0.00</span></p>
					        </div>
				      	</li>
				      	<li class="item-content">
					        <div class="item-inner text-center">
					        	<div class="item-title ticket_img">
					        		<h3>0005 4654 4561</h3>
					        		<img src="__PUBLIC__/Home/activity/img/img_01.jpg" >
					        		<p>待参与</p>
					        	</div>
					        </div>
				      	</li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title text-center" style="width:100%">活动名称活动名称活动名称活动名称活动名称</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">主办方:</div>
					          <div class="item-after">时虹时期中国</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">时　间:</div>
					          <div class="item-after">2017-08-31</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">地　点:</div>
					          <div class="item-after">广州市天河区黄埔大道55555号</div>
					        </div>
				        </li>
				    </ul>
				  </div>
			</div>
		</div>
		
		
{include file="Public:footer" /}

<script>
var  page = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_submit()
 {	 	 	 
	 	$("#all_quan").show();
        page += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/all_order/is_ajax/1/p/"+page,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#all_quan").hide();
				if($.trim(data) == ''){
					$('.all_more').hide();
				}else{
				    $("#all_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_stay = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_stay_submit()
 {	 	 	 
	 	$("#stay_quan").show();
	 	page_stay += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/stay_order/is_ajax/1/p/"+page_stay,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#stay_quan").hide();
				if($.trim(data) == ''){
					$('.stay_more').hide();
				}else{
				    $("#stay_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_not = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_not_submit()
 {	 	 	 
	 	$("#not_quan").show();
	 	page_stay += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/stay_participate_order/is_ajax/1/p/"+page_stay,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#not_quan").hide();
				if($.trim(data) == ''){
					$('.not_more').hide();
				}else{
				    $("#not_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_complete = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_complete_submit()
 {	 	 	 
	 	$("#complete_quan").show();
	 	page_complete += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/complete_order/is_ajax/1/p/"+page_complete,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#complete_quan").hide();
				if($.trim(data) == ''){
					$('.complete_more').hide();
				}else{
				    $("#complete_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_cancel = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_cancel_submit()
 {	 	 	 
	 	$("#cancel_quan").show();
	 	page_cancel += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/cancel_order/is_ajax/1/p/"+page_cancel,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#cancel_quan").hide();
				if($.trim(data) == ''){
					$('.cancel_more').hide();
				}else{
				    $("#cancel_activity").append(data);
				}
			}
		}); 
 }
 
</script>

		<script>
			Zepto(document).on('click','.open-3-modal', function () {
			    Zepto.modal({
			      title:  '进行中，确定己经参与了本活动吗？',
			      text: '',
			      buttons: [
			        {
			          text: '取消',
			          onClick: function() {
			          }
			        },
			        {
			          text: '确定',
			          color:'danger',
			          onClick: function() {
			          }
			        },
			      ]
			    })
		    });
		</script>
		<style>
			.modal-title{font-size:.75rem;}
			.modal-inner{background:#fff;}
			.modal-button{height:2rem;background:#fff;line-height:2rem;font-size:.625rem;}
			.modal-button:first-child{color:#0894ec;}
			.modal-button:last-child{color:#0894ec;}
		</style>
	</body>

</html>